## analogue of Matlab's repmat.
repmat <- function(J, K, L) {

  kronecker(matrix(1, K, L), J)

}
